<?php
/**
 * 无需登录可查看的页面渲染
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/8 0008
 * Time: 下午 3:21
 */
namespace app\admin\controller;
use think\Controller;
use think\Db;
use think\Request;

class Index extends Indexbase {
    #主页面
    public function index(){
        $admin_info = session('admin_info');
        $index_model = new \app\admin\model\Index();
        #判断是否登录
        if(!empty($admin_info)){
            $this->assign('user',$admin_info);
        }else{
            $this->assign('user','');
        }
        #显示文章内容
        $compose = $index_model->index(1);
        #旅游内容
        $travel = $index_model->index(2);
        #时尚
        $fashion = $index_model->index(3);
        #点赞 评论
        $like_com = $index_model->like_com($admin_info);
        $this->assign([
            'compose'=>$compose,'travel'=>$travel,'fashion'=>$fashion,'like_com'=>$like_com
        ]);
        return $this->fetch('./public/user/index.html');
    }

    public function single(){
        return $this->fetch('./public/user/single.html');
    }
    #文章详情
    public function articleInfo(){
        return $this->fetch('./public/user/articleInfo.html');
    }
    public function search(){
        return $this->fetch('./public/user/search.html');
    }
    #博主首页
    public function archive(){
        return $this->fetch('./public/user/archive.html');
    }
    public function archive_time(){
        return $this->fetch('./public/user/archive_time.html');
    }
    public function generic(){
        return $this->fetch('./public/user/generic.html');
    }
    public function elements(){
        return $this->fetch('./public/user/elements.html');
    }
}